<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel='stylesheet' href='./public/lucksheet/pluginsCss.css' />
<link rel='stylesheet' href='./public/lucksheet/plugins.css' />
<link rel='stylesheet' href='./public/lucksheet/luckysheet.css' />
<link rel='stylesheet' href='./public/lucksheet/iconfont.css' />
<script src="./public/lucksheet/jquery.min.js"></script>
<script src="./public/lucksheet/plugin.js"></script>
<script src="./public/lucksheet/luckysheet.umd.js"></script>
<script src="./public/lucksheet/luckyexcel.umd.js"></script>
<!-- <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/plugins.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/css/luckysheet.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/assets/iconfont/iconfont.css' />
<script src="https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/js/plugin.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luckysheet/dist/luckysheet.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luckyexcel/dist/luckyexcel.umd.js"></script> -->
</head>
<body>
  <input type="file" id="fileUpload" accept=".xlsx" />
  <div id="luckysheet" style="margin:0px;padding:0px;width:100%;height:500px;"></div>
  <script>
    $(function () {
      
        //Configuration item
        // var options = {
        //     container: 'luckysheet' //luckysheet is the container id
        // }
        // luckysheet.create(options)
        $('#fileUpload').on('change', handleFileUpload);
  
        function handleFileUpload(event) {
            var file = event.target.files[0]; 
            if (!file) return;
            LuckyExcel.transformExcelToLucky(file, function(exportJson, luckysheetfile){
              console.log(exportJson)
                // After obtaining the converted table data, use luckysheet to initialize or update the existing luckysheet workbook
                // Note: Luckysheet needs to introduce a dependency package and initialize the table container before it can be used
                luckysheet.create({
                    container: 'luckysheet', // luckysheet is the container id
                    data:exportJson.sheets,
                    title:exportJson.info.name,
                    userInfo:exportJson.info.name.creator
                });
            });
        }
    })
</script>
</body>
</html>